
import 'package:thinking/entity/_.dart';

class TagEntity {

  int? _code;
  List<Tag>? _data;
  String? _message;

  TagEntity({int? code,List<Tag>? data,String? message}){
    this._code = code;
    this._data = data;
    this._message = message;
  }

  int? get code => _code;
  set setCode(int code)=>_code = code;
  String? get message => _message;
  set setMessage(String message) => _message = message;
  List<Tag>? get data =>_data;
  set getData(List<Tag> data) => _data = data;
  TagEntity.fromJson(Map<String,dynamic> json){

    _code = json['code'];
    _data = [];
    if(json['data'] != null  ){
      json['data'].forEach((v) {
        _data!.add( Tag.fromJson(v));
      });
    }
    _message = json['message'];

  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['code'] = this._code;
    data['message'] = this._message;
    if (this._data != null) {
      data['data'] = this._data!.map((v) => v.toJson()).toList();
    }

    return data;
  }

}


class Tag {
  int? _id;
  String? _tagTitle;
  int? _tagStatus;
  String? _tagImg;
  int? _tagWatchNum;
  int? _tagSubNum;
  int? _tagCommentNum;
  int?_tagClassIndex;
  int?_tagNum;
  List<DynamicDataEntity>? _hotDynamicList;
  List<DynamicDataEntity>? _newDynamicList;
  bool? _isSub;
  Tag({
    int? id,
    String? tagTitle,
    int? tagStatus,
    String? tagImg,
    int? tagWatchNum,
    int? tagSubNum,
    int? tagCommentNum,
    int? tagClassIndex,
    int? tagNum,
    List<DynamicDataEntity>? hotDynamicList,
    List<DynamicDataEntity>? newDynamicList,
    bool? isSub

  }){
    this._id = id;
    this._tagTitle = tagTitle;
    this._tagStatus = tagStatus;
    this._tagImg = tagImg;
    this._tagWatchNum = tagWatchNum;
    this._tagSubNum = tagSubNum;
    this._tagCommentNum = tagCommentNum;
    this._tagClassIndex = tagClassIndex;
    this._tagNum = tagNum;
    this._hotDynamicList = hotDynamicList;
    this._newDynamicList = newDynamicList;
    this._isSub = isSub;

  }

  int? get id => _id;
  set setId(int id) => _id = id;
  String? get tagTitle => _tagTitle;
  set setTagTitle(String tagTitle) => _tagTitle = tagTitle;
  int? get tagStatus => _tagStatus;
  set setTagStatus(int tagStatus) => _tagStatus = tagStatus;
  String? get tagImg => _tagImg;
  set setTagImg(String tagImg) => _tagImg = tagImg;
  int? get tagWatchNum => _tagWatchNum;
  set setTagWatchNum(int tagWatchNum) => _tagWatchNum = tagWatchNum;
  int? get tagCommentNum => _tagCommentNum;
  set setTagCommentNum(int tagCommentNum) => _tagCommentNum = tagCommentNum;
  int? get tagSubNum => _tagSubNum;
  set setTagSubNum(int tagSubNum) => _tagSubNum = tagSubNum;
  int? get tagClassIndex => _tagClassIndex;
  set setTagClassIndex(int tagClassIndex) => _tagClassIndex = tagClassIndex;
  int? get tagNum => _tagNum;
  set setTagNum(int tagNum) => _tagNum = tagNum;
  List<DynamicDataEntity>? get hotDynamicList => _hotDynamicList;
  set setHotDynamicList(List<DynamicDataEntity> hotDynamicList) => _hotDynamicList = hotDynamicList;
  List<DynamicDataEntity>? get newDynamicList => _newDynamicList;
  set setNewDynamicList(List<DynamicDataEntity> newDynamicList) => _newDynamicList = newDynamicList;
  bool? get isSub => _isSub;
  set setIsSub(bool isSub) => _isSub = isSub;

  Tag.fromJson(Map<String, dynamic> json) {
    _id = json['id'];
    _tagTitle = json['tag_Title'];
    _tagStatus = json['tag_Status'];
    _tagImg = json['tag_Img'];
    _tagWatchNum = json['tag_WatchNum'];
    _tagCommentNum = json['tag_CommentNum'];
    _tagSubNum = json['tag_SubNum'];
    _tagClassIndex = json['tag_ClassIndex'];
    _tagNum = json['tag_Num'];
    if(json['hotDynamicList'] != null){
      _hotDynamicList = [];
      json['hotDynamicList'].forEach((v) {
        _hotDynamicList!.add( DynamicDataEntity.fromJson(v));
      });
    }
    if(json['newDynamicList'] != null){
      _newDynamicList = [];
      json['newDynamicList'].forEach((v) {
        _newDynamicList!.add( DynamicDataEntity.fromJson(v));
      });
    }
    _isSub = json['isSub'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this._id;
    data['tag_Title'] = this._tagTitle;
    data['tag_Status'] = this._tagStatus;
    data['tag_Img'] = this._tagImg;
    data['tag_WatchNum'] = this._tagWatchNum;
    data['tag_CommentNum'] = this._tagCommentNum;
    data['tag_SubNum'] = this._tagSubNum;
    data['tag_ClassIndex'] = this._tagClassIndex;
    data['tag_Num'] = this._tagNum;
    if (this._hotDynamicList != null) {
      data['hotDynamicList'] = this._hotDynamicList!.map((v) => v.toJson()).toList();
    }
    if (this._newDynamicList != null) {
      data['newDynamicList'] = this._newDynamicList!.map((v) => v.toJson()).toList();
    }
    data['isSub'] = this._isSub;
    return data;
  }
}

class TagPage{



  int _newDynamicPage = 0;
  int _newDynamicCount = 6;
  bool _canNewDynamic = true;

  int get newDynamicPage => _newDynamicPage;
  set setNewDynamicPage(int newDynamicPage) => _newDynamicPage = newDynamicPage;
  int get newDynamicCount => _newDynamicCount;
  set setNewDynamicCount(int newDynamicCount) => _newDynamicCount = newDynamicCount;
  bool get canNewDynamic => _canNewDynamic;
  set setCanNewDynamic(bool canNewDynamic) => _canNewDynamic = canNewDynamic;

}


